import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getwidget/getwidget.dart';
import 'package:meal/constant/antd_icons.dart';
import 'package:meal/constant/fonts.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/route/route.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';
import 'package:meal/utils/tools.dart';

class MinePage extends StatefulWidget {
  const MinePage({Key? key}) : super(key: key);

  @override
  State<MinePage> createState() => _MinePageState();
}

class _MinePageState extends State<MinePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ColorsUtils.rgba(245, 245, 245),
      appBar: BrnAppBar(
        backgroundColor: ColorsUtils.rgba(255, 110, 83, 1),
        leading: IconButton(
          icon: const Icon(
            AntdIcons.settingFill,
            color: Colors.white,
            size: Sizes.default20,
            weight: 600,
          ),
          onPressed: () {
            Get.toNamed(RouteGet.userSetting);
          },
        ),
        automaticallyImplyLeading: false,
        title: Text('我的', style: StylesUtils.customTextStyle(fontSize: Sizes.default18)),
        elevation: 0,
        titleAlignment: Alignment.center,
        actions: BrnIconAction(
          iconPressed: () {
            Get.toNamed(RouteGet.messageType);
          },
          size: Sizes.default20,
          child: ToolsUtils.getAssetImageIcon('message_fill_light.png',
              width: Sizes.default20, height: Sizes.default20),
        ),
        bottom: PreferredSize(
            preferredSize: const Size.fromHeight(Sizes.default80),
            child: GestureDetector(
              onTap: () {
                Get.toNamed(RouteGet.userStoreInfo);
              },
              child: Container(
                padding: const EdgeInsets.symmetric(vertical: Sizes.default10),
                child: Row(
                  children: [
                    Container(
                      padding: const EdgeInsets.only(left: Sizes.default20),
                      alignment: Alignment.center,
                      child: ClipOval(
                          child: ToolsUtils.getAssetImage('shop_header.png',
                              width: Sizes.default60, height: Sizes.default60)),
                    ),
                    Container(
                      width: Sizes.default180,
                      padding: const EdgeInsets.only(top: Sizes.default10),
                      margin: const EdgeInsets.only(left: Sizes.default20),
                      child: Column(
                        children: [
                          Container(
                            alignment: Alignment.centerLeft,
                            child: Text('默林如斯的广东肠粉早餐店(凤凰广场店)',
                                style: StylesUtils.customTextStyle(
                                    fontWeight: Fonts.w5, fontSize: Sizes.default15)),
                          ),
                          Container(
                            alignment: Alignment.centerLeft,
                            margin: const EdgeInsets.only(top: Sizes.default10),
                            child: Text(
                              '账号：1359798710',
                              style: StylesUtils.customTextStyle(
                                  fontSize: Sizes.default13, color: ColorsUtils.colorCcc),
                            ),
                          )
                        ],
                      ),
                    )
                  ],
                ),
              ),
            )
        ),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              margin: const EdgeInsets.only(top: Sizes.default10),
              color: Colors.white,
              padding: const EdgeInsets.symmetric(horizontal: Sizes.default20),
              child: Column(
                children: [
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    decoration: BoxDecoration(
                        border: Border(bottom: BorderSide(color: ColorsUtils.rgba(153, 153, 153, 0.095)))
                    ),
                    child: GestureDetector(
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              GFAvatar(
                                backgroundColor: ColorsUtils.parseColorFromHexString('#EDA096'),
                                size: Sizes.default25,
                                child: ToolsUtils.getUrlSvg(
                                    'https://cdn7.axureshop.com/demo/1525603/images/我的/u10581.svg',
                                    width: Sizes.default15,
                                    height: Sizes.default13),
                              ),
                              Text('商店公告',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                      onTap: () {
                        Get.toNamed(RouteGet.noticeAdd);
                      },
                    )
                  ),
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    decoration: BoxDecoration(
                        border: Border(bottom: BorderSide(color: ColorsUtils.rgba(153, 153, 153, 0.095)))
                    ),
                    child: InkWell(
                      onTap: () {
                        Get.toNamed(RouteGet.userStoreManage);
                      },
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              GFAvatar(
                                backgroundColor: ColorsUtils.parseColorFromHexString('#EDA096'),
                                size: Sizes.default25,
                                child: ToolsUtils.getAssetImageIcon('store.png',
                                    width: Sizes.default20, height: Sizes.default20),
                              ),
                              Text('店铺管理',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                    ),
                  ),
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    decoration: BoxDecoration(
                        border: Border(bottom: BorderSide(color: ColorsUtils.rgba(153, 153, 153, 0.095)))
                    ),
                    child: InkWell(
                      onTap: () {
                        Get.toNamed(RouteGet.userStoreRent);
                      },
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              GFAvatar(
                                backgroundColor: ColorsUtils.parseColorFromHexString('#FF9933'),
                                size: Sizes.default25,
                                child: ToolsUtils.getAssetImageIcon('hire.png',
                                    width: Sizes.default20, height: Sizes.default20),
                              ),
                              Text('店铺招店',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15)),
                              Container(
                                  constraints: const BoxConstraints.tightFor(
                                      width: Sizes.default40, height: Sizes.default20),
                                  alignment: Alignment.center,
                                  decoration: BoxDecoration(
                                      borderRadius:
                                      const BorderRadius.all(Radius.circular(Sizes.default3)),
                                      border: Border.all(color: ColorsUtils.rgba(204, 0, 0, 1))),
                                  child: Center(
                                    child: Text(
                                      '审核中',
                                      style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.colorCc0, fontSize: Sizes.default12),
                                    ),
                                  ))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                    )
                  ),
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    decoration: BoxDecoration(
                        border: Border(bottom: BorderSide(color: ColorsUtils.rgba(153, 153, 153, 0.095)))
                    ),
                    child: InkWell(
                      onTap: () {
                        Get.toNamed(RouteGet.userStoreEnv);
                      },
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              const GFAvatar(
                                backgroundImage: NetworkImage(
                                    'https://cdn7.axureshop.com/demo/1525603/images/我的/u10606.png'),
                                size: Sizes.default25,
                                backgroundColor: Colors.transparent,
                              ),
                              Text('门店环境',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                    )
                  ),
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    child: InkWell(
                      onTap: () {
                        Get.toNamed(RouteGet.userStoreInvite);
                      },
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              GFAvatar(
                                backgroundImage: ToolsUtils.assetImageIcon('take.png'),
                                size: Sizes.default25,
                                backgroundColor: Colors.transparent,
                              ),
                              Text('到店自取',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                    )
                  ),
                ],
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default10),
              padding: const EdgeInsets.symmetric(horizontal: Sizes.default20),
              decoration: const BoxDecoration(
                color: Colors.white
              ),
              child: Column(
                children: [
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    decoration: BoxDecoration(
                        border: Border(bottom: BorderSide(color: ColorsUtils.rgba(153, 153, 153, 0.095)))
                    ),
                    child: InkWell(
                      onTap: () {
                        Get.toNamed(RouteGet.userAptitudeInfo);
                      },
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              const GFAvatar(
                                backgroundImage: NetworkImage(
                                    'https://cdn7.axureshop.com/demo/1525603/images/我的/u10573.png'),
                                size: Sizes.default25,
                                backgroundColor: Colors.transparent,
                              ),
                              Text('资质信息',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                    )
                  ),
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    child: InkWell(
                      onTap: () {
                        Get.toNamed(RouteGet.userAccountInfo);
                      },
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              const GFAvatar(
                                backgroundImage: NetworkImage(
                                    'https://cdn7.axureshop.com/demo/1525603/images/我的/u10572.png'),
                                size: Sizes.default25,
                                backgroundColor: Colors.transparent,
                              ),
                              Text('账户信息',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                    )
                  ),
                ],
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: Sizes.default10),
              padding: const EdgeInsets.symmetric(horizontal: Sizes.default20),
              decoration: const BoxDecoration(
                  color: Colors.white
              ),
              child: Column(
                children: [
                  Container(
                    height: Sizes.default50,
                    alignment: Alignment.centerLeft,
                    child: InkWell(
                      onTap: () {
                        Get.toNamed(RouteGet.userHelpCenter);
                      },
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Wrap(
                            spacing: Sizes.default10,
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: [
                              GFAvatar(
                                size: Sizes.default25,
                                backgroundColor: ColorsUtils.parseColorFromHexString('#7EC5EF'),
                                child: ToolsUtils.getAssetImageIcon('answer.png', width: Sizes.default20, height: Sizes.default20),
                              ),
                              Text('帮助中心',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color363, fontSize: Sizes.default15))
                            ],
                          ),
                          BrunoTools.getAssetSizeImage(
                              BrnAsset.iconRightArrow, Sizes.default16, Sizes.default16)
                        ],
                      ),
                    )
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
